package com.github.butid.data.rpc;

import com.alipay.remoting.InvokeCallback;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * @author wangjing.dc@qq.com
 * @since 2020/8/20
 */
@Slf4j
public class RpcCallback implements InvokeCallback {

    Executor executor = Executors.newCachedThreadPool();

    @Override
    public void onResponse(Object result) {
//        log.warn("Result received in callback: " + result);
    }

    @Override
    public void onException(Throwable e) {
        log.error("Process exception in callback.", e);
    }

    @Override
    public Executor getExecutor() {
        return executor;
    }

}
